<template>
	<view class="content bg_com">
		<view class="menu_warp">
			<view class="_item row_center">
				<view class="left">
					已绑定手机号
				</view>
				<view class="right row_center">
					<view class="txt">
						{{user.phone || '未绑定'}}
					</view>
					<!-- <i class="iconfont icon-arrow-right"></i> -->
				</view>
			</view>
			<view class="_item row_center" @click="jumpYouth">
				<view class="left">
					青少年模式
				</view>
				<view class="right row_center">
					<view class="txt">
						{{user.securityMode | securFormdata}}
					</view>
					<i class="iconfont icon-arrow-right"></i>
				</view>
			</view>
			<view class="_item row_center" @click="quitFun">
				<view class="left">
					退出并更换账号
				</view>
				<view class="right row_center">
					<i class="iconfont icon-arrow-right"></i>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapActions,
		mapState
	} from 'vuex';
	export default {
		filters: {
			securFormdata: function(value) {
				return (value + '' === '1') ? '已开启' : '已关闭';
			}
		},
		computed: mapState(['user']),
		data() {
			return {

			}
		},
		methods: {
			...mapActions(['LogOut']),
			jumpYouth() {
				uni.navigateTo({
					url: '../youthMode/youthMode'
				})
			},
			quitFun() {
				uni.showModal({
				    title: '提示',
				    content: '确定退出登录吗？',
				    success: (res) => {
				        if (res.confirm) {
				            this.LogOut();
							uni.switchTab({
								url: '../tabBar/index/index'
							})
				        } else if (res.cancel) {
				            console.log('用户点击取消');
				        }
				    }
				});
			}
		}
	}
</script>

<style lang="scss">
	@import "@/static/iconfont/iconfont.css";

	@font-face {
		font-family: 'iconfont';
		src: url('~@/static/iconfont/iconfont.ttf');
	}

	@import './index.scss';
</style>
